<template>
  <view class="container">
    <u-navbar title="协商历史" height="50"></u-navbar>
    <view v-for="item in consultList" :key="item.id" class="item-view">
      <view class="order-goods">
        <u-icon
          class="goods-img"
          :name="item.content.includes('买家') ? avatar : ``"
          size="120"
        ></u-icon>
        <view class="orde-riget">
          <view class="goods-title">
            {{ item.content }}
          </view>
          <view class="goods-speci">
            {{ item.createTime }}
          </view>
          <view v-if="item.content.includes('回')" class="desc">
            <p>物流公司：顺丰快递 </p>
            <p>物流单号：SF20000194358934</p>
          </view>
        </view>
      </view>
      <!-- <view class="remark">
        备注：退款成功
      </view> -->
    </view>
    <!-- <view class="item-view">
      <view class="order-goods">
        <u-icon class="goods-img" name="" size="120"></u-icon>
        <view class="orde-riget">
          <view class="goods-title"> 商家通过退款申请 </view>
          <view class="goods-speci"> 2023-10-25&nbsp;10:00 </view>
        </view>
      </view>
      <view class="remark"> 备注：您的退款申请已经通过，欢迎再次光临本店 </view>
    </view>
    <view class="item-view" v-if="status == 2">
      <view class="order-goods">
        <u-icon class="goods-img" :name="avatar" size="120"></u-icon>
        <view class="orde-riget">
          <view class="goods-title"> 用户寄回商品 </view>
          <view class="goods-speci"> 2023-10-25&nbsp;10:00 </view>
        </view>
      </view>
      <view class="desc">
        <p>物流公司：顺丰快递 </p>
        <p>物流单号：SF20000194358934</p>
      </view>
    </view>
    <view class="item-view" v-if="status == 2">
      <view class="order-goods">
        <u-icon class="goods-img" name="" size="120"></u-icon>
        <view class="orde-riget">
          <view class="goods-title"> 商家同意退款 </view>
          <view class="goods-speci"> 2023-10-25&nbsp;10:00 </view>
        </view>
      </view>
      <view class="desc">
        <p>退货地址：贵州省贵阳市南明区花果园大街100号 </p>
        <p>收件人：张三（19188989898）</p>
        <p>备注：同意</p>
      </view>
    </view> -->
    <view class="middle">
      <!-- <view class="order-goods">
        <u-icon class="goods-img" :name="avatar"></u-icon>
        <view class="orde-riget">
          <view class="goods-title"> 用户申请退款 </view>
          <view class="goods-speci"> 2023-10-25&nbsp;10:00 </view>
        </view>
      </view> -->
      <view class="desc">
        <p>交易单号：{{ refunInfo.orderNo }} </p>
        <p>申请原因：{{ refunInfo.applyDescription }}</p>
        <p>申请金额：¥{{ refunInfo.refundPrice }} </p>
        <p>申请时间：{{ refunInfo.refundTime }}</p>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      status: 2,
      stepNum: 0,
      order_id: '',
      order_refund_id: '',
      refundType: '',
      refunInfo: {},
      avatar: '',
      consultList: []
    }
  },
  onLoad(options) {
    let arr = []
    this.avatar = uni.getStorageSync('userInfo').avatar
    this.consultList = JSON.parse(options.consultList).reverse()
    this.refunInfo = JSON.parse(options.refunInfo)
    // this.order_id = options.order_id
    // this.order_refund_id = options.order_refund_id

    // this.$u.api.getRefundDetail(options.order_id, {order_refund_id : options.order_refund_id}).then(res=>{
    // 	this.refunInfo = res.data

    // 	if(this.refunInfo.status != 1){
    // 		this.numList = [{
    // 			name: '申请退款'
    // 		}, {
    // 			name: this.refunInfo.refund_result
    // 		}]
    // 		this.stepNum = 1
    // 	}

    // 	this.$u.api.getTypeRefund().then(res2=>{
    // 		res2.data.forEach(item => {
    // 			if(this.refunInfo.refund_type_id == item.id){
    // 				this.refundType = item.name
    // 			}
    // 		})

    // 	})
    // })
  },
  methods: {
    previewImg(e) {
      uni.previewImage({
        current: 0,
        urls: e
      })
    },
    routeTo() {
      uni.navigateTo({
        url: '/other/express/express'
      })
    }
  }
}
</script>

<style lang="scss" scoped>
@import url('../../style/btn.css');

page {
  background: #eeeeef;
  padding: 20rpx;
}

.item-view {
  background-color: #fff;
  padding: 20rpx 15rpx;
  font-size: 30rpx;
  position: relative;
  margin: 20rpx 0;
}

.more {
  position: absolute;
  top: 20rpx;
  right: 20rpx;
}

.middle {
  background-color: #fff;
  padding: 20rpx;
}

.order-goods {
  display: flex;
  border-bottom: #ededed solid 2rpx;
  padding-bottom: 15rpx;
}

.goods-img {
  border-radius: 20rpx;
}

.orde-riget {
  width: 100%;
  margin-left: 10rpx;
  line-height: 65rpx;
  font-size: 26rpx;
}

.goods-title {
  font-size: 30rpx;
}

.goods-speci {
  color: #999999;
}

.goods-num {
  position: absolute;
  top: 0;
  right: 0;
  color: #999999;
}

.goods-price {
  font-size: 30rpx;
  color: #f54831;
}

.desc {
  margin-top: 20rpx;
}

.desc p {
  margin-bottom: 15rpx;
}

.remark {
  padding: 15rpx 0;
}
</style>
